#include "InputDeviceListener.h"

//----------------------------------------------------------------------------------
InputDeviceListener::InputDeviceListener()
{

}

//----------------------------------------------------------------------------------
InputDeviceListener::~InputDeviceListener()
{

}

//----------------------------------------------------------------------------------
bool InputDeviceListener::mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id)
{
	CEGUI::System::getSingleton().injectMouseButtonDown((CEGUI::MouseButton)id);
	return true;
}
//----------------------------------------------------------------------------------
bool InputDeviceListener::mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id )
{
	CEGUI::System::getSingleton().injectMouseButtonUp((CEGUI::MouseButton)id);
	return true;
}
//----------------------------------------------------------------------------------
bool InputDeviceListener::keyReleased(const OIS::KeyEvent &evt )
{
	CEGUI::System::getSingleton().injectKeyUp(evt.key);
	return true;
}
//----------------------------------------------------------------------------------
bool InputDeviceListener::keyPressed(const OIS::KeyEvent &evt )
{
	CEGUI::System::getSingleton().injectKeyDown(evt.key);
	CEGUI::System::getSingleton().injectChar(evt.text);
	return true;
}
//----------------------------------------------------------------------------------
bool InputDeviceListener::mouseMoved(const OIS::MouseEvent &evt)
{
	CEGUI::System::getSingleton().injectMouseMove(evt.state.X.rel,evt.state.Y.rel);
	return true;
}